Skip to content

chore(deploy): :staging image tag + notify infra on migration changes#188

Merged
mastermanas805 merged 4 commits into
masterfrom
cf/staging-image-publish
May 30, 2026
Merged

chore(deploy): :staging image tag + notify infra on migration changes#188
mastermanas805 merged 4 commits into
masterfrom
cf/staging-image-publish

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Add :staging tag to the existing buildx --push (line 251 of deploy.yml). Every master push now publishes ghcr.io/instanode-dev/instant-api:staging alongside the existing :version and :latest tags.
  • New notify-infra-on-migration.yml workflow: sends repository_dispatch type migrations-changed to instanode-dev/infra when internal/db/migrations/** changes on master, triggering an immediate rebuild of the pg-platform staging Container image.
  • Graceful no-op when INFRA_DISPATCH_TOKEN secret is unset (logs notice, exits 0; infra's daily cron remains the fallback).

Why

The CF Containers staging environment at infra/wrangler/api/wrangler.toml pulls the :staging tag. The pg-platform staging image at infra/wrangler/pg-platform/Dockerfile bakes all 63 platform migrations into /docker-entrypoint-initdb.d/ — without the notify workflow, new migrations don't reach staging for up to 24h.

Companion PR: InstaNode-dev/infra#32

Test plan

  • CI: existing Deploy workflow green (unchanged behavior except one extra -t flag on buildx)
  • CI: notify-infra-on-migration.yml shows the "skip if token unset" path on the first run (since the secret hasn't been set yet)
  • After merge: confirm ghcr.io/instanode-dev/instant-api:staging digest matches :latest for the same SHA via gh api packages/...
  • Operator runs gh secret set INFRA_DISPATCH_TOKEN -R instanode-dev/api to enable the dispatch path
  • Touch a migration file → notify workflow → infra wrangler-build-staging-images.yml fires within ~2min

🤖 Generated with Claude Code

… changes

The CF Containers staging environment pulls api images via the :staging
tag (see infra/wrangler/api/wrangler.toml). Add :staging alongside the
existing :version and :latest tags so every master push produces a
staging-ready image.

Also adds a notify-infra-on-migration workflow that sends a
repository_dispatch to instanode-dev/infra when migrations change,
triggering an immediate rebuild of the pg-platform staging Container
image (which bakes all 63 migrations into /docker-entrypoint-initdb.d).
Without this, infra's daily cron picks up the change with ~24h lag.

Graceful no-op if INFRA_DISPATCH_TOKEN secret is unset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pulls in 4759b67+ so diff-cover can find the merge base for patch
coverage. Pre-existing coverage.yml uses --depth=1 fetch which can't
find the base when origin/master advances after the branch is cut.
@mastermanas805 mastermanas805 merged commit bf7567a into master May 30, 2026
14 checks passed
@mastermanas805 mastermanas805 deleted the cf/staging-image-publish branch May 30, 2026 07:20
mastermanas805 added a commit that referenced this pull request May 30, 2026
…ublish" (#197)

This reverts commit bf7567a, reversing
changes made to c63951a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant